﻿<?php   
       //include_once('init.php');
      if(!empty($_POST)) { 

        
        //Array ( [name] => 湿答答 [status] => option1 [power] => Array ( [0] => [1] => [2] => ) ) 
     $_POST['power']=implode(',',$_POST['power']);

      
       $_rows= add($GLOBALS['c'],$_POST);

    //判断影响的行数是否大于0，大于表示添加成功则跳到新闻列表页面，小于则失败则返回原来的页面
    if ($_rows>0) {
        echo '<script>alert("添加成功"); location.href="index.php?c=role&a=list&admin=1";</script>';die;
        # code...
    }else{
        echo'<script>alert("添加成功");history.go(-1);</script>';die;
    }

      }
      

        $data=selectmore('power',"pid=0");
        $fei=selectmore('power',"pid!=0");
       

        // print_r($data); 
        // print_r($fei);die;  
//       $data=selectmore('power','pid=0');
//       $news=selectmore('power','pid=1');
//       $admin=selectmore('power','pid=2');
//       $cate=selectmore('power','pid=3');
// print_r($cate);die;




 include VIEW_PATH.$admin.'layout.html';


